package ${domain}.module.${moduleName}.req;

import ${domain}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
<#if table.has('Date')>
import java.util.Date;
</#if>
<#if table.has('Dict')>
import ${domain}.frame.validation.Dict;
</#if>
<#if table.has('Select')>
import ${domain}.frame.validation.Select;
</#if>

/**
 * ${table.getCName()}CreateRequest - ${table.tableComment}新增
 *
 * @author ${author?default("")}
 * @version 0.0.1
 * @since ${.now?string["yyyy-MM-dd"]}
 */
public class ${table.getCName()}CreateRequest extends BaseRequest {
<#list table.fields as field>
<#if !field.isSystem>

    /**
     * ${field.fieldComment?default("")}.
    <#if field.fieldType?contains("Select")>
        <#list field.selectItems as item>
     * ${item.value}:${item.label}
        </#list>
    </#if>
     */
    <#if field.isMust && !field.fieldType?contains("String")>
    @NotNull(message = "[${field.getFName()}]${field.fieldComment?default("")}不能为NULL")
    </#if>
    <#if field.isMust && field.fieldType?contains("String_")>
    @NotBlank(message = "[${field.getFName()}]${field.fieldComment?default("")}不能为空")
    </#if>
    <#if field.fieldType?contains("String_") && field.fieldType != 'String_super'>
    @Length(min = 0, max = ${field.fieldLength}, message = "[${field.getFName()}]${field.fieldComment?default("")}长度不合法(0-${field.fieldLength})")
    </#if>
    <#if field.fieldType?contains("Dict")>
    @Dict(name = "${field.getFieldName()}")
    </#if>
    <#if field.fieldType?contains("Select")>
    @Select(${toString(field.selectItems)})
    </#if>
    private ${field.getFieldTypeJava()} ${field.getFName()};
</#if>
</#list>
<#list table.fields as field>
<#if !field.isSystem>

    public ${field.getFieldTypeJava()} ${field.getterName()}() {
        return this.${field.getFName()};
    }

    public void ${field.setterName()}(${field.getFieldTypeJava()} ${field.getFName()}) {
        this.${field.getFName()} = ${field.getFName()};
    }
</#if>
</#list>
}
